package com.zjhcsoft.auth.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Author: wzya
 * @Date: 2021/3/23
 */
public class MyUtils {

    /*
    * 手机号码合法性校验
    * */
    public static boolean MobileValidate(String mobile) {
        String regex = "^(1[3-9]\\d{9}$)";
        if (mobile.length() == 11) {
            Pattern p = Pattern.compile(regex);
            Matcher m = p.matcher(mobile);
            if (m.matches()) {
                return true;
            }
        }
        return false;
    }
}
